package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Value("${aa}")
    private String test;

    @Autowired
    private Environment environment;

    @RequestMapping("test/{aaa}")
    public String test(@PathVariable String aaa){

        return environment.getProperty(aaa);
    }
}
